var app = getApp(),
  $ = require("../../utils/httpHelper.js")
var wxParse = require("../../wxParse/wxParse.js")
Page({
  data: {
    userInfo: {},
    size:['1','2','3','4','5'],
    page: 1,
    pagesize: 10,
    totalpage: 0,//最大页数,
    objnews:{}
  },
  onLoad: function (options) {
    var that = this;
    wx.getSystemInfo({
      success: function (res) {
        console.log(res);
        that.setData({ height: res.windowHeight })
      }
    })
    if (!app.check_empty(options.id)){
      
      $.httpPost("news_detail", { id: options.id }, (data, err) => {
        this.setData({
          objnews:data.data.data
        })
        wxParse.wxParse("about", "html", data.data.data.content, this)
      })
      
    }
    
    
    
  },
  //滑动到底部 上拉加载
  scrollBottom: function () {
    this.data.page++
    if (this.data.page > this.data.totalpage) {
      this.setData({
        nomore: false
      })
    } else {
      let params = {
        rd_session: app.globalData.userInfo.rd_session,
        page: this.data.page,
        pagesize: this.data.pagesize,
        status: this.data.status
      }
      $.httpPost('order_list', params, (data, err) => {
        let arr = this.data.objarr;
        for (let item of data.data.order_list) {
          arr.push(item);
        }
        this.setData({
          objarr: arr
        })
      })


    }

  },
  
});